home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / dev / c / libmpeg_src.lha / extras / ParseArgv.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-22  |  2.4 KB  |  84 lines

  1. /*
  2.  * ParseArgv.h --
  3.  *
  4.  *    Declarations for Tk-related things that are visible
  5.  *    outside of the Tk module itself.
  6.  *
  7.  * Copyright 1989-1992 Regents of the University of California.
  8.  * Permission to use, copy, modify, and distribute this
  9.  * software and its documentation for any purpose and without
  10.  * fee is hereby granted, provided that the above copyright
  11.  * notice appear in all copies.  The University of California
  12.  * makes no representations about the suitability of this
  13.  * software for any purpose.  It is provided "as is" without
  14.  * express or implied warranty.
  15.  *
  16.  * This file has been modified to be used only for argv parsing without
  17.  * reference to tk, tcl or X11. Base on tk.h from tk2.3
  18.  * $Header: /usr/people/greg/src/gl_mpeg/RCS/ParseArgv.h,v 1.1 94/07/04 11:15:12 greg Exp $ SPRITE (Berkeley)
  19.  */
  20.  
  21. /*
  22.  * Definitions that allow this header file to be used either with or
  23.  * without ANSI C features like function prototypes.
  24.  */
  25.  
  26. #undef _ANSI_ARGS_
  27. #if ((defined(__STDC__) || defined(SABER)) && !defined(NO_PROTOTYPE)) || defined(__cplusplus)
  28. #   define _ANSI_ARGS_(x)    x
  29. #else
  30. #   define _ANSI_ARGS_(x)    ()
  31. #endif
  32.  
  33. /*
  34.  * Structure used to specify how to handle argv options.
  35.  */
  36.  
  37. typedef struct {
  38.     char *key;        /* The key string that flags the option in the
  39.              * argv array. */
  40.     int type;        /* Indicates option type;  see below. */
  41.     char *src;        /* Value to be used in setting dst;  usage
  42.              * depends on type. */
  43.     char *dst;        /* Address of value to be modified;  usage
  44.              * depends on type. */
  45.     char *help;        /* Documentation message describing this option. */
  46. } ArgvInfo;
  47.  
  48. /*
  49.  * Legal values for the type field of a ArgvInfo: see the user
  50.  * documentation for details.
  51.  */
  52.  
  53. #define ARGV_CONSTANT        15
  54. #define ARGV_INT            16
  55. #define ARGV_STRING            17
  56. #define ARGV_REST            19
  57. #define ARGV_FLOAT            20
  58. #define ARGV_FUNC            21
  59. #define ARGV_GENFUNC            22
  60. #define ARGV_HELP            23
  61. #define ARGV_END            27
  62.  
  63. /*
  64.  * Flag bits for passing to ParseArgv:
  65.  */
  66.  
  67. #define ARGV_NO_DEFAULTS        0x1
  68. #define ARGV_NO_LEFTOVERS        0x2
  69. #define ARGV_NO_ABBREV        0x4
  70. #define ARGV_DONT_SKIP_FIRST_ARG    0x8
  71. #define ARGV_NO_PRINT 0x16
  72.  
  73.  
  74. /*
  75.  *--------------------------------------------------------------
  76.  *
  77.  * Exported procedures and variables.
  78.  *
  79.  *--------------------------------------------------------------
  80.  */
  81. extern int ParseArgv _ANSI_ARGS_((int *argcPtr, char **argv,
  82.                                   ArgvInfo *argTable, int flags));
  83.  
  84.